package com.ktjy.pojo.system;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serial;
import java.io.Serializable;

/**
 * 访问记录表实体类
 *
 * @author LILIBO
 * @since 2025-06-18
 */
@Tag(name = "访问记录表", description = "访问记录表数据")
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@TableName("`sys_login_record`")
public class SysLoginRecord implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 访问记录ID
     */
    @Schema(description = "访问记录ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 访问者IP地址
     */
    @Schema(description = "访问者IP地址")
    private String ipaddr;

    /**
     * 访问者地点
     */
    @Schema(description = "访问者地点")
    private String location;

    /**
     * 使用的浏览器类型
     */
    @Schema(description = "使用的浏览器类型")
    private String browser;

    /**
     * 使用的操作系统
     */
    @Schema(description = "使用的操作系统")
    private String clientOs;

    /**
     * 登录者ID
     */
    @Schema(description = "登录者ID")
    private Long userId;

    /**
     * 登录账号
     */
    @Schema(description = "登录账号")
    private String userName;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remark;

    /**
     * 状态 0-成功;1-失败
     */
    @Schema(description = "状态 0-成功;1-失败")
    private Integer status;

    /**
     * 记录时间
     */
    @Schema(description = "记录时间")
    private String recordTime;

    /**
     * 带参构造方法
     */
    public SysLoginRecord(String ipaddr, String location, String browser, String clientOs, Long userId, String userName, String remark, Integer status, String recordTime) {
        this.ipaddr = ipaddr;
        this.location = location;
        this.browser = browser;
        this.clientOs = clientOs;
        this.userId = userId;
        this.userName = userName;
        this.remark = remark;
        this.status = status;
        this.recordTime = recordTime;
    }

}
